
%{
isConnected=controllers.Security.isConnected();
}%

<h2>News</h2>

<ul>
  #{list items:models.News.findAll(), as:'News'}
  	<li><b><a href="@{Application.ViewNews(News.id)}">${News.Title}</a></b></li>
  #{/list}

 </ul>

<style>
	fieldset {
    border: 1px solid #CCCCCC;
    margin: 200px auto 0;
    padding: 1.4em;
    width: 400px;
}
p {
    margin: 0 0 1.5em;
    text-align: center;
}
</style>
			
<form id="login-form"  action=@{Secure.authenticate()} method="post">
	#{if isConnected}
	<br><br><br>
	<b><center> Sorry, you are logged in already!!</center></b><br><br>
	<a href = "http://localhost:9000/"> <center> Click Here to go to Home Page</center></a><br><br>
	<a href = "http://localhost:9000/secure/logout"> <center> Click Here to go to log out</center></a><br><br>
	#{/if}
	#{else}	
	<fieldset>
		
		#{if flash.error}
			<p class="error">
				&{flash.error}
			</p>
		#{/if}
		#{if flash.success}
			<p class="success">
				&{flash.success}
			</p>
		#{/if}
		<div id="ideascale-login">

			<div class="field" data-role="fieldcontain">
				<label for="username">
					Username
				</label>
				<input id="username" name="username" type="text" class="text"/>
			</div>
			<div class="field" data-role="fieldcontain">
				<label for="password-value">
					Password
				</label>
				<input id="password-value" name="password" type="password" class="text"/>
			</div>
			<div class="no-label">
				
			</div>
			<button type="submit" id="signin" class="button">
				Sign In
			</button>
		
		</div>
	</fieldset>
	#{/else}
</form>

